package gupao.concurrency.service;

import gupao.concurrency.enums.TrafficChannelEnum;
import gupao.concurrency.model.ForecastConfig;
import gupao.concurrency.model.TimeWindow;
import org.springframework.stereotype.Service;

@Service
public class ForcastConfigService {

    public TimeWindow createNewTimeWindow(TrafficChannelEnum channelEnum, long periodInMillis) {
        TimeWindow timeWindow = new TimeWindow();
        timeWindow.setStartTimestamp(System.currentTimeMillis());
        timeWindow.setEndTimestamp(timeWindow.getStartTimestamp() + periodInMillis);
        //insert into db
        return timeWindow;
    }

    public ForecastConfig queryForcastConfig() {
        return new ForecastConfig(10, 1, TrafficChannelEnum.DEFAULT,
                10, 100);
    }
}
